/*
 * Created on 27/02/2013 - 9:55 PM
 * 
 */
package sembr.vtk.data.input;

import vtk.vtkPolyData;
import vtk.vtkSphereSource;

/**
 *
 * @author adriano
 */
public class Sphere extends SourceBase {

    private vtkSphereSource sphere;
    private double radius;
    private double[] center;

    public Sphere(double radius, double center[]) {
        
        this.radius = radius;
        this.center = center;
        setSphere(new vtkSphereSource());
    }

    /**
     * @return the radius
     */
    public double getRadius() {
        
        return radius;
    }

    /**
     * @param radius the radius to set
     */
    public void setRadius(double radius) {
        
        this.radius = radius;
    }

    /**
     * @return the center
     */
    public double[] getCenter() {
        
        return center;
    }

    /**
     * @param center the center to set
     */
    public void setCenter(double[] center) {
        
        this.center = center;
    }

    /**
     * @return the sphere
     */
    public vtkSphereSource getSphere() {
        
        return sphere;
    }

    /**
     * @param sphere the sphere to set
     */
    private void setSphere(vtkSphereSource sphere) {
        
        this.sphere = sphere;
        this.sphere.SetCenter(getCenter());
        this.sphere.SetRadius(getRadius());
        this.sphere.SetPhiResolution(200);
        this.sphere.SetThetaResolution(200);
    }

    @Override
    public vtkPolyData getPolyData() 
    {
        return getSphere().GetOutput();
    }
}
